package com.scau.classOnline.model;

import java.util.Objects;

/**
 * Create by ji on 2019-07-12
 *
 * 重写了hashCode和equals方法，根据课程名称和老师姓名判断是否为同一门课
 */
public class CourseListModel {
    private Integer id;
    private Integer uid;
    private String username;
    private String name;
    private String title;
    private String iconUrl;
    private Boolean finished;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CourseListModel that = (CourseListModel) o;
        return Objects.equals(uid, that.uid) &&
                Objects.equals(username, that.username) &&
                Objects.equals(name, that.name) &&
                Objects.equals(title, that.title) &&
                Objects.equals(iconUrl, that.iconUrl) &&
                Objects.equals(finished, that.finished);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uid, username, name, title, iconUrl, finished);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public Boolean getFinished() {
        return finished;
    }

    public void setFinished(Boolean finished) {
        this.finished = finished;
    }
}
